﻿using UnityEngine;
using System.Collections;

[RequireComponent(typeof(SpriteRenderer))]
public class BombAnimation : MonoBehaviour
{
    AnimationFrames animationFrames;
	// Use this for initialization
	void Awake () {
        
        animationFrames = GetComponent<AnimationFrames>();
	}
	
	public void ChangeResources(EBombState eBombState, EBombType eBombType)
    {
        switch (eBombState)
        {
            case EBombState.EXPLORE:
                animationFrames.createAnimation(DatabaseDirectory.Explosion, 1.0f);
                break;
            case  EBombState.IDLE:
                switch (eBombType)
                {
                    case EBombType.BLACK:
                        animationFrames.createAnimation(DatabaseDirectory.BombBlack, 1.0f);
                        break;
                    case EBombType.BLUE:
                        animationFrames.createAnimation(DatabaseDirectory.BombBlue, 1.0f);
                        break;
                    case EBombType.GREEN:
                        animationFrames.createAnimation(DatabaseDirectory.BombGreen, 1.0f);
                        break;
                    case EBombType.PINK:
                        animationFrames.createAnimation(DatabaseDirectory.BombPink, 1.0f);
                        break;
                    case EBombType.RED:
                        animationFrames.createAnimation(DatabaseDirectory.BombRed, 1.0f);
                        break;
                    case EBombType.YELLOW:
                        animationFrames.createAnimation(DatabaseDirectory.BombYellow, 1.0f);
                        break;
                }
                break;
        }
    }
}
